<script setup lang="ts">
import CdlTable from "@/components/table";
import {Mode, Query, State, FormData} from "@/interfaces/components/Page";
import {useRouter} from "vue-router";
import {reactive} from "vue";
import {useTablePagingTemplate} from "@/hooks/TableHooks";
import {Message} from "@/interfaces/views/message/message";
import {TableTree} from "@/interfaces/components/Table";
import CdlForm from "@/components/form";
import {FormTree} from "@/interfaces/components/Form";

const router = useRouter()
const request = {
  createdIsNeed: true,
  url: "/project/project",
}
const state = reactive<State<Query<Message>, Message>>({
  queryForm: {},
  dataList: []
})
const {query} = useTablePagingTemplate(request, state)
const tree: TableTree<Message> = {
  colRule: [
    {ti: "接收号码"},
    {ti: "司机姓名"},
    {ti: "任务开始时间"},
    {ti: "任务开始地点"},
    {ti: "接收号码"},
  ],
  control: [
    {name: "删除", type: "danger", method: ()=> {}}
  ]
}
const messageFormTree: FormTree<Message> = [
    [
      {label: "短信模板", component: "input"},
      {label: "短信接收人", component: "radio", options: [
          {label: "全部司机", value: 1},
          {label: "全部托运方", value: 2},
        ]},
    ],
    [
      {label: "短信内容", component: "input", type: "textarea", style: "width: 50%"}
    ]
]
const messageData: FormData<Message> = {

}

function jumpShipperInsertShipperInsert(){
  router.push({
    path: "/vehicleManage/shipper/createAndModifyShipper"
  })
}
/**
 * 回调处理
 * @param mode
 * @param data
 */
function popupCallBack(mode: Mode, data: any){

}
</script>

<template>
  <el-card>
    <CdlForm :model="messageData" :template-tree="messageFormTree"></CdlForm>
    <CdlTable :template-tree="tree" :data="state.dataList"></CdlTable>
  </el-card>
</template>
